<?php

namespace App\Controller\User;


use App\Controller\BaseController;
use App\Request\User\TeaseRequest;
use App\Services\User\ChatService;
use Hyperf\Context\Context;
use Hyperf\Di\Annotation\Inject;

class ChatController extends BaseController
{

    #[Inject]
    public ChatService $chatService;


    /**
     * Note - 一键打招呼
     * DateTime 2024/8/14 14:06
     * User Admin
     */
    public function tease(TeaseRequest $request)
    {
        $params = $this->request->post();
        $request->execute($params);
        $userInfo = Context::get('user');
        $params['language'] = Context::get('language');
        $result = $this->chatService->tease($userInfo, $params);
        return $this->return($result);

    }


    /**
     * Note - 批量获取打招呼用户(今日缘分，只有男用户有)
     * DateTime 2024/8/15 10:17
     * User Admin
     * @return \Psr\Http\Message\ResponseInterface
     */
    public function getBatchGreetUser()
    {
        $userInfo = Context::get('user');
        $result = $this->chatService->getBatchGreetUser($userInfo);
        return $this->return($result);
    }

}